﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Manage.aspx.cs" Inherits="plugin_Manage" %>

<%@ Register src="../Common/UserControls/WebSiteCategoryDDL.ascx" tagname="WebSiteCategoryDDL" tagprefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<HTML>
	<HEAD runat="server">
	<script language="javascript" type="text/javascript">
	function EndRequestHandler(sender, args)
{
   if (args.get_error() != undefined)
   {
       if ((args.get_response().get_statusCode() == '12007') || (args.get_response().get_statusCode() == '12029'))
       {
               alert('请检查您是否已经连接到Internet');
       }
   }
}


	</script> 
	</HEAD>
	<body>
		<form id="Form1" method="post" runat="server">
		<asp:ScriptManager ID="ScriptManager1" runat="server" ></asp:ScriptManager>
		<h2>新建/修改插件</h2>
			<div class="mframe">
				<table width="700" align="center" cellspacing="0" cellpadding="0">
					<tr>
						<td class="ml"></td>
						<td class="mm">
							<table cellpadding="3" width="95%" align="center">
								<tr>
									<td align="right" width="120">
										采集名称：
									</td>
									<td>
										<asp:textbox id="TB_GatherName" runat="server" Width="120"></asp:textbox><asp:requiredfieldvalidator id="RFV_GatherName" runat="server" ErrorMessage="*" Display="Dynamic" ControlToValidate="TB_GatherName"></asp:requiredfieldvalidator>
									&nbsp;线程数：<asp:TextBox ID="txtPluginThreadNumber" runat="server" Width="39px"></asp:TextBox>
									&nbsp;所属网站：<asp:DropDownList ID="ddlWebSite" runat="server">
                                        </asp:DropDownList>
									    分类：<uc1:WebSiteCategoryDDL ID="WebSiteCategoryDDL1" runat="server" />
									</td>
								</tr>
								<tr>
									<td align="right" width="120">
										列表开始地址：
									</td>
									<td>
										<asp:textbox id="TB_ListUrl" runat="server" Width="400"></asp:textbox><asp:requiredfieldvalidator id="RFV_ListUrl" runat="server" ErrorMessage="*" Display="Dynamic" ControlToValidate="TB_ListUrl"></asp:requiredfieldvalidator>
									</td>
								</tr>
								<tr>
									<td align="right" width="120">
										网页编码：
									</td>
									<td>
										<asp:DropDownList ID="ddlEncode" runat="server">
                                            <asp:ListItem>Default</asp:ListItem>
                                            <asp:ListItem>GB2312</asp:ListItem>
                                            <asp:ListItem>utf-8</asp:ListItem>
                                        </asp:DropDownList>
									<asp:Label ID="lblRunStatus" runat="server" Visible="False"></asp:Label>
									</td>
								</tr>
								<tr>
									<td align="right" width="120">
										采集数目：
									</td>
									<td>
										<asp:TextBox id="TB_Num" runat="server" Width="60">0</asp:TextBox>["0"为无限多]
										<asp:RequiredFieldValidator id="RFV_Num" runat="server" Display="Dynamic" ControlToValidate="TB_Num" ErrorMessage="*"></asp:RequiredFieldValidator>
										<asp:RegularExpressionValidator id="REV_Num" runat="server" ErrorMessage="必须为数字" ValidationExpression="[0-9]{1,}"
											ControlToValidate="TB_Num"></asp:RegularExpressionValidator>
									</td>
								</tr>
								<tr>
									<td align="right" width="120">
										下载站外图片：
									</td>
									<td>
										<asp:RadioButtonList id="DownImg" RepeatDirection="Horizontal" runat="server">
											<asp:ListItem Value="1">是</asp:ListItem>
											<asp:ListItem Value="0">否</asp:ListItem>
										</asp:RadioButtonList>[后续功能]
									</td>
								</tr>
								<tr>
									<td align="right" width="120">
										下载站外Flash：
									</td>
									<td>
										<asp:RadioButtonList id="DownFlash" RepeatDirection="Horizontal" runat="server">
											<asp:ListItem Value="1">是</asp:ListItem>
											<asp:ListItem Value="0">否</asp:ListItem>
										</asp:RadioButtonList>[后续功能]
									</td>
								</tr>
								<tr>
									<td align="right" width="120">
										是否有效：</td>
									<td>
										<asp:RadioButtonList id="isValid" RepeatDirection="Horizontal" runat="server">
											<asp:ListItem Value="1">是</asp:ListItem>
											<asp:ListItem Value="0">否</asp:ListItem>
										</asp:RadioButtonList>
									</td>
								</tr>
								<tr>
									<td align="right" width="120">
										采集深度：</td>
									<td>
										<asp:TextBox id="TB_Depth" runat="server" Width="60"></asp:TextBox>
									</td>
								</tr>
				                <tr>
									<td align="left" colspan="2" >
										说明：请先打开 <a href="MakeRule.htm" target="_blank">规则生成器</a> 进行获取规则的生成，然后将生成的规则复制进下面相应的匹配规则文本框中。<br />
										<ul>
										<li>匹配url:([\S\s][^<>]*?)</li>
										<li>匹配文本:([\S\s]*?)</li>
										</ul>
										</td>									
								</tr>
								<tr>
									<td colspan="2" class="tdbg-dark">
										》》<b>列表匹配规则</b>
									</td>
								</tr>
								<tr>
									<td align="right">
										列表范围：
									</td>
									<td>
										<asp:textbox id="TB_ListArea" runat="server" Width="400px"></asp:textbox>
										<asp:RequiredFieldValidator id="RFV_ListArea" runat="server" ErrorMessage="*" Display="Dynamic" ControlToValidate="TB_ListArea"></asp:RequiredFieldValidator>
									</td>
								</tr>
								<tr>
									<td align="right">
										列表链接：</td>
									<td>
										<asp:textbox id="TB_ListURLRule" runat="server" Width="400px"></asp:textbox>
									</td>
								</tr>
								<tr>
									<td align="right">
										列表下一页：
									</td>
									<td>
										<asp:textbox id="TB_ListNextUrl" runat="server" Width="400"></asp:textbox>
									</td>
								</tr>
								<tr>
									<td align="right">
										内容页链接：
									</td>
									<td>
										<asp:TextBox id="TB_PageUrl" runat="server" Width="400px"></asp:TextBox>
										<asp:RequiredFieldValidator id="RFV_PageUrl" runat="server" ErrorMessage="*" Display="Dynamic" ControlToValidate="TB_PageUrl"></asp:RequiredFieldValidator>
									</td>
								</tr>
								<tr>
									<td align="right">
										内容下一页：
									</td>
									<td>
										<asp:TextBox id="TB_PageNextUrl" runat="server" Width="400"></asp:TextBox>
									</td>
								</tr>
								
								<tr>
									<td colspan="2" class="tdbg-dark">
										》》<b>内容匹配规则</b>
									</td>
								</tr>
								<tr>
									<td align="right">
										标题：
									</td>
									<td>
										<asp:TextBox id="TB_Title" runat="server" Width="400"></asp:TextBox>
										<asp:RequiredFieldValidator id="RFV_Title" runat="server" ErrorMessage="*" Display="Dynamic" ControlToValidate="TB_Title"></asp:RequiredFieldValidator>
									</td>
								</tr>
								<tr>
									<td align="right">
										市场价：</td>
									<td>
										<asp:TextBox id="TB_originalPrice" runat="server" Width="400"></asp:TextBox>
									</td>
								</tr>
								<tr>
									<td align="right">
										网站价：</td>
									<td>
										<asp:TextBox id="TB_salePrice" runat="server" Width="400"></asp:TextBox>
									</td>
								</tr>
								<tr>
									<td align="right">
										内容：
									</td>
									<td>
										<asp:TextBox id="TB_Content" runat="server" Width="400"></asp:TextBox>
										<asp:RequiredFieldValidator id="RFV_Content" runat="server" ErrorMessage="*" Display="Dynamic" ControlToValidate="TB_Content"></asp:RequiredFieldValidator>
									</td>
								</tr>
								<tr>
									<td align="right">
										作者：
									</td>
									<td>
										<asp:TextBox id="TB_Author" runat="server" Width="400"></asp:TextBox>
									</td>
								</tr>
								<tr>
									<td align="right">
										来源：
									</td>
									<td>
										<asp:TextBox id="TB_From" runat="server" Width="400"></asp:TextBox>
									</td>
								</tr>
								<tr>
									<td align="right">
										日期：
									</td>
									<td>
										<asp:TextBox id="TB_Date" runat="server" Width="400"></asp:TextBox>
									</td>
								</tr>
								
								<tr>
									<td align="right">
										增加辅助内容：</td>
									<td>
										<asp:TextBox ID="txtGenericNumber" runat="server" Width="46px"></asp:TextBox>
&nbsp;<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                                            ControlToValidate="txtGenericNumber" ErrorMessage="*" 
                                            ValidationExpression="\d+"></asp:RegularExpressionValidator>
&nbsp;<asp:Button ID="btnGeneric" runat="server" 
                                            onclick="Button1_Click" Text="生成标签" />
                                        <asp:Label ID="lblNumber" runat="server"></asp:Label>
                                        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                            <ContentTemplate>
                                                <asp:PlaceHolder ID="ph" runat="server"></asp:PlaceHolder>
                                            </ContentTemplate>
                                            <Triggers>
                                                <asp:AsyncPostBackTrigger ControlID="btnGeneric" EventName="Click" />
                                            </Triggers>
                                        </asp:UpdatePanel>
                                        <br />
									</td>
								</tr>
								<tr>
									<td colspan="2" class="tdbg-dark">
										》》<b>内容过滤[每项设置用回车键分割]</b>
									</td>
								</tr>
								<tr>
									<td align="right">
										过滤内容：
									</td>
									<td>
										<asp:TextBox id="TB_Filter" runat="server" TextMode="MultiLine" Width="400px" Height="80px"></asp:TextBox>
									</td>
								</tr>
								<tr>
									<td height="30" align="center" colspan="2">
										<asp:Button id="Bt_GatherAdd" runat="server" Text="提交" 
                                            onclick="Bt_GatherAdd_Click"></asp:Button>
									    <asp:Label ID="lblmsg" runat="server"></asp:Label>
									</td>
								</tr>
							</table>
						</td>
						<td class="mr"></td>
					</tr>
				</table>
				<table width="700" align="center" cellspacing="0" cellpadding="0">
					<tr>
						<td class="bl"></td>
						<td class="bm">&nbsp;</td>
						<td class="br"></td>
					</tr>
				</table>
			</div>
		</form>
	</body>
</HTML>